#include <stdio.h>
#include <stdbool.h>

int main(){
	int digitSeen[10] = {0};

	printf("Enter a digit:");
	long n;
	int digit;

	scanf("%ld", &n);
	while (n>0) {
		digit = n % 10;
		digitSeen[digit]++;
		n = n/10;
	}
	printf("Digit:         ");
	for (int i = 0; i < sizeof(digitSeen)/sizeof(digitSeen[0]); ++i){
		printf("%d  ", i);
	}
	printf("\nOccurrences:   ");
	for (int i = 0; i < sizeof(digitSeen)/sizeof(digitSeen[0]); ++i){
		printf("%d  ", digitSeen[i]);
	}
	printf("\n");
}
